package com.example.zhangxin.myhuatuob2b.fragment.home.store;


import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.zhangxin.myhuatuob2b.R;
import com.example.zhangxin.myhuatuob2b.activity.LoginActivity;
import com.example.zhangxin.myhuatuob2b.activity.RegisteredActivity;

/**
 * A simple {@link Fragment} subclass.
 */
public class StoreFragment extends Fragment implements View.OnClickListener {


    private ImageView image_logo_not_login;
    private TextView loginNameID;
    private ImageView userPicID;
    private TextView pointID;
    private TextView predepoitID;
    private TextView availableRcBalanceID;
    private RelativeLayout rl_login_flag_ok;
    private RelativeLayout rlayout;
    private ImageView image_icon1;
    private RelativeLayout rly2;
    private LinearLayout orderID;
    private ImageView image_icon3;
    private RelativeLayout rly4;
    private LinearLayout fav_store_ID;
    private ImageView image_icon31;
    private RelativeLayout rly41;
    private LinearLayout fav_goods_ID;
    private ImageView image_icon4;
    private RelativeLayout rly5;
    private LinearLayout couponID;
    private ImageView image_icon42;
    private RelativeLayout rly52;
    private LinearLayout addressID;
    private LinearLayout ll_user_choose_show;
    private ImageView btn_user_login_ID;
    private ImageView btn_user_regin_ID;
    private LinearLayout ll_item_user_login_flag_NO;

    public StoreFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_store, container, false);

        initView(view);
        initListener();
        return view;
    }

    private void initListener() {

        btn_user_login_ID.setOnClickListener(this);
        btn_user_regin_ID.setOnClickListener(this);
    }

    private void initView(View view) {
        btn_user_login_ID = (ImageView) view.findViewById(R.id.btn_user_login_ID);
        btn_user_regin_ID = (ImageView) view.findViewById(R.id.btn_user_regin_ID);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.btn_user_login_ID:
                startActivity(new Intent(getActivity(), LoginActivity.class));
                break;
            case R.id.btn_user_regin_ID:
                startActivity(new Intent(getActivity(), RegisteredActivity.class));
                break;
        }
    }
}
